package com.bear.atlassianmcp.jira.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

import java.util.Map;

/**
 * Jira User数据模型
 * 对应Jira REST API返回的User对象
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class JiraUser {

    private String self;
    private String name;
    private String key;
    private String emailAddress;
    private String displayName;
    private boolean active;
    private String timeZone;
    private Map<String, String> avatarUrls;

    /**
     * 格式化为AI友好的文本描述
     */
    public String toFormattedString() {
        StringBuilder sb = new StringBuilder();
        sb.append("User: ").append(displayName).append(" (").append(name).append(")").append("\n");
        sb.append("Email: ").append(emailAddress).append("\n");
        sb.append("Active: ").append(active ? "Yes" : "No").append("\n");
        if (timeZone != null) {
            sb.append("Timezone: ").append(timeZone).append("\n");
        }
        return sb.toString();
    }

    // Getters and Setters
    public String getSelf() {
        return self;
    }

    public void setSelf(String self) {
        this.self = self;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getEmailAddress() {
        return emailAddress;
    }

    public void setEmailAddress(String emailAddress) {
        this.emailAddress = emailAddress;
    }

    public String getDisplayName() {
        return displayName;
    }

    public void setDisplayName(String displayName) {
        this.displayName = displayName;
    }

    public boolean isActive() {
        return active;
    }

    public void setActive(boolean active) {
        this.active = active;
    }

    public String getTimeZone() {
        return timeZone;
    }

    public void setTimeZone(String timeZone) {
        this.timeZone = timeZone;
    }

    public Map<String, String> getAvatarUrls() {
        return avatarUrls;
    }

    public void setAvatarUrls(Map<String, String> avatarUrls) {
        this.avatarUrls = avatarUrls;
    }
}
